<#-- @ftlvariable name="entity" type="com.xci.platform.auth.entity.RoleEntity" -->
<#include "/_inc/_layout.ftl">
<#import "/auth/_inc/_dic.ftl" as dic>
<#assign url=html.saveUrls("/auth/role/create-save","/auth/role/edit-save")/>
<@header/>
<div class="jxpanel winpanel" data-fit="true">
    <form id="editform" class="jxform" method="post" action="${url}">
        <input name="id" value="${entity.id!}" type="hidden">
        <table class="table jxtable-form">
            <tr>
                <th class="w-100px">组织机构</th>
                <td>
                    <input id="departmentName"
                           name="departmentName"
                           class='form-control jxcombotree'
                           data-value="${entity.departmentId!}"
                           data-validate="required: [true,'请选择组织机构']"
                           data-options="
                            editable: false, showClear: false, hiddenField: 'departmentId',panelHeight: '250px',
                            treeOptions: {
                                url: '<@html.url "/auth/department/tree"/>',
                                defaultIconCls: 'icon-users'
                            }"
                    >
                </td>
            </tr>
            <tr>
                <th>分类</th>
                <td>
                    <select class="form-control jxselect" name="categoryId" data-allow-clear="true" data-text-field="categoryName">
                        <option></option>
                        <@dic.systemRoleCategory selectedValue=entity.categoryId/>
                    </select>
                </td>
            </tr>
            <tr>
                <th>名称</th>
                <td>
                    <input class="form-control" name="name" value="${entity.name!}" maxlength="30"
                           data-validate="required: [true,'请输入角色名称'],maxlength: 30" autocomplete="off"/>
                </td>
            </tr>
            <tr>
                <th>状态</th>
                <td>
                    <label>
                        <input class="jxcheck" name="status" <@html.isChecked value=entity.status /> type="checkbox" value="1"
                               data-unchecked-value="0"/> 启用
                    </label>
                </td>
            </tr>
            <tr>
                <th>备注</th>
                <td>
                    <textarea class="form-control" name="remark" maxlength="1000" data-validate="maxlength: 1000" rows="3"
                              style="resize: none">${entity.remark!}</textarea>
                </td>
            </tr>
        </table>
    </form>
    <div class="panel-footer text-right">
        <@html.editPanelFooter/>
    </div>
</div>
<@footer>
    <script>
        jx.auth.bindEditFormSuccess();
    </script>
</@footer>